namespace ISAPI_Python {

	namespace Win32Helpers {
		
		typedef DWORD (FASTCALL *WORKER_THREAD_CALLBACK) (
			PVOID parameter
			);

		class WorkerThreadPool {
		protected:
			void Init(const DWORD poolSize);
		
			HANDLE IoPort;
			DWORD PoolSize;
			LPHANDLE PooledThreads;
			struct UserCallback
			{
				WORKER_THREAD_CALLBACK callback;
				PVOID callbackArgument;
			};

			
			DWORD WorkerCallback();	

			static DWORD WINAPI ThreadCallback(LPVOID lpThreadParameter);

		private:
			WorkerThreadPool(const WorkerThreadPool& workerThreadPool);
			WorkerThreadPool& operator = (const WorkerThreadPool& otherWorkerThreadPool);

		public:
			WorkerThreadPool();
			WorkerThreadPool(const DWORD poolSize);
			~WorkerThreadPool();

			void QueueWorkItem(WORKER_THREAD_CALLBACK callback, PVOID callbackArgument);
		};
	}
}